package top.tomxwd.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.tomxwd.common.Result;
import top.tomxwd.entity.Payment;
import top.tomxwd.service.PaymentFeignService;

/**
 * @author xieweidu
 * @createDate 2020-08-02 9:38
 */
@RestController
@Slf4j
@RequestMapping("/order")
public class OrderFeignController {

    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("/payment/getById/{id}")
    public Result<Payment> create(@PathVariable("id") Long id){
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping("/timeout")
    public String timeout(){
        return paymentFeignService.timeout();
    }

}
